<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正文</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/list.css">

    <!-- 一定要引入 editormd 的依赖, 才能使用这里的方法 -->
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <link rel="stylesheet" href="editor.md/css/editormd.min.css" />
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>
</head>
<body>
    <div class="nav">
        <img src="../img/logo.png" alt="">
        <span class="title">TQ02博客系统</span>
        <span class="spacer"></span>
        <a href="write.html">写博客</a>
        <a href="../logout">退出</a>
        <a href="./cancel.html">销户</a>
    </div>

    <div class="container">
        <div class="left">
            <img src="../img/头像.jpg" alt="">
            <h3></h3>
            <div style="margin-bottom: 10px;margin-top: 10px">
                <span>文章</span>
            </div>
            <div class="counter">
                <span></span>
            </div>
        </div>
        <div class="right">
             <!-- 博客标题 -->
            <h1></h1>
            <!-- 博客时间 -->
            <div class="data"></div>
            <!-- 博客正文 -->
            <div id="content">

            </div>

        </div>
    </div>

    <script src="js/app.js"></script>
    <script>

        function getBlog(){
            $.ajax({
                url:'../blog'+location.search,
                type:'get',
                success:function (body){
                     let h3=document.querySelector('.right h1');
                     h3.innerHTML=body.title;
                     let dateDiv=document.querySelector('.data');
                     dateDiv.innerHTML=body.postTime;
                     editormd.markdownToHTML('content',{markdown:body.content})
                }
            })
        }
        getBlog();
        checkLogin();
    </script>

</body>
</html>